package cn.akwangl.design.pattern.structural.flyweight;

/**
 * 享元模式Test.
 * <p>
 * 实例<br/>
 * {@link java.lang.Integer}<br/>
 * {@link org.apache.commons.pool2.impl.GenericObjectPool}<br/>
 * <p/>
 *
 * @author youyongkun
 * @date 2021/11/26 10:53
 * @since 1.0
 */
public class Test {
    /**
     * 角色
     */
    private static final String[] DEPARTMENTS = {"RD", "QA", "PM", "BD"};

    public static void main(String[] args) {
        for (int i = 0; i < 10; i++) {
            String department = DEPARTMENTS[(int) (Math.random() * DEPARTMENTS.length)];
            Manager manager = (Manager) EmployeeFactory.getManager(department);
            manager.report();
        }
    }
}
